﻿@{
    ViewBag.Title = "Settings";
    ViewBag.SettingsActive = "active";
}

<h2>Settings</h2>
@model Sweepids.Models.Object.User

@if (TempData["Error"] != null)
{
    <div class="alert alert-error">
        @TempData["Error"]
    </div>
}

@if (TempData["Success"] != null)
{
    <div class="alert alert-success">
        @TempData["Success"]
    </div>
}

<div class="container-fluid">
    <div class="row-fluid">
        <div class="span6 well">

            <h4>User Information</h4>

            <form class="form-horizontal" method="POST" action="~/Settings/EditInfo">
                <div class="control-group">
                    <div class="controls" hidden="hidden">
                        <input type="text" name ="username" value="@Model.Username" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="username2">Username</label>
                    <div class="controls">
                        <input type="text" disabled="disabled" name="username2" value="@Model.Username" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="password">Password</label>
                    <div class="controls">
                        <input type="text" name="password" value="@Model.Password" pattern="[A-Za-z0-9]+" title="Only letters and numbers" required />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="firstname">First Name</label>
                    <div class="controls">
                        <input type="text" name="firstname" value="@Model.FirstName" pattern="[A-Za-z]+" title="Only letters" required />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="lastname">Last Name</label>
                    <div class="controls">
                        <input type="text" name="lastname" value="@Model.LastName" pattern="[A-Za-z]+" title="Only letters" required />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="email">Email Address</label>
                    <div class="controls">
                        <input type="text" name="email" value="@Model.Email" pattern="\w+&#64;\w+\.[\w.]+" title="Valid email" required />
                    </div>
                </div>
                <h4>Shipping Information</h4>
                <div class="control-group">
                    <label class="control-label" for="address">Address</label>
                    <div class="controls">
                        <input type="text" name="address" value="@Model.Address" pattern="[A-Za-z0-9 ]+" title="Only letters and numbers" required />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="city">City</label>
                    <div class="controls">
                        <input type="text" name="city" value="@Model.ZipObj.City" pattern="[A-Za-z ]+" title="Only letters and numbers" required />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="state">State</label>
                    <div class="controls">
                        <input type="text" name="state" value="@Model.ZipObj.State" pattern="[A-Z]{2}" title="Two digit, Uppercase" required />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="zip">Zip Code</label>
                    <div class="controls">
                        <input type="text" name="zip" value="@Model.Zip" pattern="[\d]{5}" title="Valid zip code" required />
                    </div>
                </div>
                <h4>Credit Card Information</h4>
                <div class="control-group">
                    <label class="control-label" for="cardNumber">Credit Card Number</label>
                    <div class="controls">
                        <input type="text" name="cardNumber" value="@Model.CreditCardObj.CardNum" pattern="[\d]{16}" title="Valid credit card numbers, no dashes or spaces" required />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="expDate">Expiration Date</label>
                    <div class="controls">
                        <input type="text" name="expDate" value="@Model.CreditCardObj.ExpDate.ToString("MM/yy")" pattern="\d{2}\/\d{2}" title="MM/YY" required />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="secCode">Security Code</label>
                    <div class="controls">
                        <input type="text" name="secCode" value="@Model.CreditCardObj.SecCode" pattern="\d{3}" title="Valid security code" required />
                    </div>
                </div>
                <input type="submit" class="btn btn-primary" value="Submit" />
            </form>
        </div>
    </div>
</div>

